import {
    PASSWORD_PATTERN,
    PASSWORD_PATTERN_TIP,
    USER_NAME_PATTERN,
    USER_NAME_PATTERN_TIP
} from "@/constant/validation-constants.ts";

import type { FormRules } from "naive-ui";


export default {
    username: [
        {
            required: true,
            message: "请输入用户名",
            trigger: ["blur"]
        },
        {
            pattern: USER_NAME_PATTERN,
            message: USER_NAME_PATTERN_TIP,
            trigger: ["blur"]
        }
    ],
    password: [
        {
            required: true,
            message: "请输入密码",
            trigger: ["blur"]
        },
        {
            pattern: PASSWORD_PATTERN,
            message: PASSWORD_PATTERN_TIP,
            trigger: ["blur"]
        }
    ]
} as FormRules